package day11HomeWork;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class CollectionDemo3 {
    public static void main(String[] args) {
        Collection<String> c = new ArrayList<>();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        c.add("five");
        Iterator<String> it = c.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }
        for (String e:c){
            System.out.println(e);
        }


        }
    }

